For a digital camera, when capturing images in a large lighting ratio environment, an ordinary camera cannot record extremely light or dark details due to being limited by a dynamic range, while HDR video recording can obtain better light and shade levels than the normal shooting in high light and low light regions. A dynamic range of an actual scene is usually above 100 dB, and a sensor is a core imaging component in a digital imaging apparatus. A sensor element employed by the conventional digital camera includes a Charge-Coupled Device (CCD) or a Complementary Metal Oxide Semiconductor (CMOS) device, which generally can only have a dynamic range of about 60 dB. If a sensor with a narrower dynamic range is employed to record a scene with a wider dynamic range, multiple images need to be generated. Taking a 100 dB scene as an example, it is possible to first increase a shutter speed to shoot an underexposure photo of 0-60 dB, then to decrease the shutter speed to shoot an overexposure photo of 40-100 dB, and finally to fuse the two photos into one photo by re-calculating a gray scale mapping relationship.
Existing manufacturers capture HDR video by using high frame-rate sensors, which can continuously capture several images with different exposure values at a high speed, and synthesize the images into one image in HDR format. After multiple frames of images are captured, it is necessary to use a special HDR algorithm to merge the multiple frames into one frame. However, when capturing multiple images of a moving subject, a ghost effect may occur in the HDR image.
A modern CMOS sensor generally has a color filter array structure, and an image captured through a Bayer filter array is called a Bayer diagram for short. Each pixel records monochromatic information of 10-14 bits, and RGB trichromatic information needs to be calculated through interpolation between the current pixel and its surrounding pixels.
The existing method of capturing HDR video mainly includes two key technical features, multi-exposure frame capture and an HDR frame-merging algorithm. The multi-exposure frame capture obtains multiple frames of picture through a high-speed continuous shooting with different exposure values. There are two disadvantages: on the one hand, if there is an object moving in the scene at a high speed, it is impossible to make point-by-point matching between two frames, and motion blurring is easy to occur in a merged picture; on the other hand, the high-speed continuous shooting requires an extremely high frame rate, which limits a lower limit of the shutter for video shooting.
The HDR algorithm first estimates a luminance response function of the camera based on multiple exposure frames, then calculates a new gray scale table by gray scale mapping, and finally calculates a new HDR image. Because estimating the luminance response function of the camera generally needs to conduct parameter estimation on all gray scales, while the calculation complexity may be acceptable for an 8-bit image (256 gray scales), the calculation amount is too great for the Bayer diagram (14 bits), and thus the luminance response function cannot be directly applied to HDR video recording. Weighted average is another common frame-merging method. Taking merging of two frames of pictures as an example, a merged pixel value pnew may be calculated by using the formula (1):pnew=w1p1+(1−w1)p2  (1)
where P1 and P2 are pixel values of a certain designated position on an underexposure map and an overexposure map, respectively, and W1 is a number between 0 and 1, representing the weight that P1 accounts for in a merged pixel. Under the conventional method, factors generally considered when assigning the weights mainly include conventional overexposure and underexposure of the pixel, and it is common to set a threshold to detect abnormity of exposure. The weight of the overexposure or underexposure pixel may be far lower than that of a normal pixel value. By taking an 8-bit image as an example, the weight is calculated by using the formula (2):
                              ω          1                =                  {                                                                                                                                        T                        1                                            -                                              p                        1                                                                                    T                      1                                                        ,                                                                                                  p                    1                                    <                                      T                    1                                                                                                                                                                                          p                        2                                            -                                              T                        2                                                                                    255                      -                                              T                        2                                                                              ,                                                                                                  p                    2                                    >                                      T                    2                                                                                                                                            1                    2                                    ,                                                            others                                                                        (        2        )            
where T1 and T2 are underexposure and overexposure thresholds, respectively. Such a simple distinction between overexposure and underexposure is not good for adaptability to the scene, artifacts may be easy to occur, and unnatural transition may occur in pixel merging.